<header>
    <title>节点{notempty name="info"}修改{else /}添加{/notempty}</title>
</header>
{include file="public/header" /}
<!-- 内容主体区域 -->
<br />
<div style="padding: 15px;">

    <form class="layui-form" action="add" method="post">
        {notempty name='info'}<input type="hidden" name="id" value="{$info.id}">{/notempty}

        <div class="layui-form-item">
            <label class="layui-form-label">权限名称：</label>
            <div class="layui-input-block">
                <input type="text" style="width: 240px;" {notempty name='info'}value="{$info.node_name}"{/notempty}  name="node_name" required  lay-verify="required" placeholder="请输入权限名" autocomplete="off" class="layui-input">
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">权限URL</label>
            <div class="layui-input-inline">
                <input type="text" name="c_name" {notempty name='info'}value="{$info.c}"{/notempty} required lay-verify="required" placeholder="请输入控制器名" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-input-inline">
                <input type="text" name="a_name" {notempty name='info'}value="{$info.a}"{/notempty} required lay-verify="required" placeholder="请输入方法名" autocomplete="off" class="layui-input">
            </div>
        </div>



        <div class="layui-form-item">
            <label class="layui-form-label">父级权限：</label>
            <input type="radio" name="partent_level" title="顶级分类" value="0/1" {notempty name='info'}{if $info['node_partent']==0}checked{/if}{/notempty} >
            <br /><hr class="layui-bg-red">
            <div class="layui-input-block">
                {foreach $list as $key=>$vo }
                <label class="layui-form-label">二级分类：</label><br>
                    <input type="radio" name="partent_level" title="{$vo.node_name}"  value="{$vo.id}/2" {notempty name='info'}{if $info['node_partent']==$vo['id']}checked{/if}{/notempty} > &nbsp<br>
                <label class="layui-form-label">三级分类：</label><br>
                    {foreach $vo.children as $k=>$v }
                        <input type="radio" name="partent_level" title="{$v.node_name}" value="{$v.id}/3"  {notempty name='info'}{if $info['node_partent']==$v['id']}checked{/if}{/notempty}>
                    {/foreach}
                <hr class="layui-bg-orange">

                {/foreach}
            </div>
        </div>

<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">状态</label>-->
<!--            <div class="layui-input-block">-->
<!--                <input type="radio" name="status" value="0" title="启用"  checked>-->
<!--                <input type="radio" name="status" value="1" title="未启用">-->
<!--            </div>-->
<!--        </div>-->

<!--        &nbsp; &nbsp; &nbsp; &nbsp;等级：<div class="layui-input-inline">-->
<!--           <select name="node_grade">-->
<!--                <option value="1">顶级分类</option>-->
<!--                <option value="2">二级分类</option>-->
<!--                <option value="3">三级分类</option>-->
<!--            </select>-->
<!--        </div>-->
        <div class="layui-form-item layui-form-text">
        </div>
        <br>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>

    <script>
        //Demo
        layui.use('form', function(){
            var form = layui.form;

            //监听提交
            /*form.on('submit(formDemo)', function(data){
                layer.msg(JSON.stringify(data.field));
                return false;
            });*/
        });
    </script>
    {include file="public/footer" /}